<template>
  <div>
    <h1>大头 子组件</h1>
    <input type="text" v-model="info" />
    <button @click="getInfo">获取info的值</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      info: "",
    };
  },
  methods: {
    getInfo() {
      console.log(this.info);
      // 在子组件当中有个值 info  将info传递给父组件小头
      console.log(this.$emit);
      this.$emit("addItem", this.info);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>